﻿// ----------------------------------------------------------------------------
// <copyright file="PositionPointToLeftUpPointConverter.cs" company="Insigma" >
//     Copyright (c) 浙江浙大网新众合轨道交通工程有限公司 版权所有。
// </copyright>
// <author> 龙珩 </author>
// <date> 2011-08-02</date>
// <summary> PositionPoint到LeftUpPoint X坐标的转换 </summary>
// -----------------------------------------------------------------------
using System;
using System.Globalization;
using System.Windows.Data;

namespace DCT.View
{
    public class PositionPointXToCanvasLeftConverter : IMultiValueConverter
    {
        public object Convert(object[] value, Type typeTarget, object param, CultureInfo culture)
        {
            if (typeTarget == typeof(double))
            {
                double positionPointY = (double)value[0];
                double originPointY = (double)value[1];
                double height = (double)value[2];
                return positionPointY - (height + 1) * originPointY;
            }

            return null;
        }

        public object[] ConvertBack(object value, Type[] typeTarget, object param, CultureInfo culture)
        {
            return null;
        }
    }
}
